#lang racket
;Bubble-sort(Сортировка пузырьком)
(define (swap-pairs lst)  
    (cond  
      [(empty? (cdr lst)) lst]  
      [( < (car lst) (cadr lst)) (cons (cadr lst)(swap-pairs (cons (car lst) (cddr lst))))]
      ( else 
        (cons (car lst) (swap-pairs (cdr lst)))
        ) 
     )
  ) 

(define (bubble-sort lst)  
    (cond 
      [(empty? lst) lst]  
      (else
       (let ((lst-sorted (reverse (swap-pairs lst))))(cons (car lst-sorted) (bubble-sort (cdr lst-sorted))))
       )
      )
  )
  